<?php

namespace frontend\controllers;

use common\models\Customer;
use Yii;
use yii\web\Controller;

class CustomerController extends Controller
{
    public function actionIndex()
    {
        $customers = Customer::find()->all();
        return $this->render('index', ['customers' => $customers]);
    }

    public function actionCreate()
    {
        $model = new Customer();
        if ($model->load(Yii::$app->request->post())) {
            $model->save();
            return $this->redirect('index');
        }
        return $this->render('create', ['model' => $model]);
    }
}